
import {request} from '@/utils/request'//导入封装好的js文件

export const getMyPostList = (id,current,pageSize)=>{
    return request({
        url:`/article/front/my/${id}/${current}/${pageSize}`,
        method:'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export const getMyLikeNum = (id)=>{
    return request({
        url:`/article/front/my/like/${id}`,
        method:'get',
        header:{
            isToken: false,
            repeatSubmit: false
        }
    })
}

export const getMyCollections = (id,current,pageSize)=>{
    return request({
        url:`/article/front/collection/my/${id}/${current}/${pageSize}`,
        method:'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export const getMyChannels = (current,pageSize)=>{
    return request({
        url:`/channel/front/my/${current}/${pageSize}`,
        method:'get',
        header:{
            isToken: false,
            repeatSubmit: false
        }
    })
}


export const getFrontUserInfo = (id)=>{
    return request({
        url:`/user/front/info/${id}`,
        method:'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export const alterFrontUserAvatar = (data)=>{
    return request({
        url:`/user/front/alter/avatar`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const alterFrontUserBackground = (data)=>{
    return request({
        url:`/user/front/alter/background`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const alterFrontUserIntro = (data)=>{
    return request({
        url:`/user/front/alter/intro`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const alterFrontUserBirthday = (data)=>{
    return request({
        url:`/user/front/alter/birthday`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const alterFrontUserSex = (sex)=>{
    return request({
        url:`/user/front/alter/sex/${sex}`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export const alterFrontUsername = (data)=>{
    return request({
        url:`/user/front/alter/username`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const alterFrontUserLocation = (data)=>{
    return request({
        url:`/user/front/alter/location`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}
export const alterFrontUserSchool = (data)=>{
    return request({
        url:`/user/front/alter/school`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const getCountryList = ()=>{
    return request({
        url:`/info/country`,
        method:'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export const getStateList = (data)=>{
    return request({
        url:`/info/state`,
        method:'post',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}
export const getCityList = (data)=>{
    return request({
        url:`/info/city`,
        method:'post',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const searchUser = (data)=>{
    return request({
        url:`/user/search`,
        method:'post',
        header:{
            isToken: true,
            repeatSubmit: false
        },
        data
    })
}

export const followUser = (id, isFollow)=>{
    return request({
        url:`/follow/front/${id}/${isFollow}`,
        method:'put',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}








